<?php 
	$model = new Model_Menu_Menu();
?>
<div class="box"> <!-- Box begins here -->
	<h2>Danh sách Video | <a class="add" href="<?php echo $this->url(array("module"=>"administrator","controller"=>"video","action"=>"add"),null,true); ?>">Thêm</a></h2>
	
	<form name="form-search" method="post" action="<?php echo $this->url(array("module"=>"administrator","controller"=>"video","action"=>"search"),null,true); ?>" enctype="multipart/form-data">
	<fieldset><legend>Tìm kiếm</legend>
			<div class="input_field">
				<label for="keyword">Từ khóa :</label>									
 				<?php echo $this->formText("keyword",null,null); ?>
 			</div>
 		<input class="submit" type="submit" value="Tìm kiếm" />
	</fieldset>
	</form>
	
	<?php echo $this->paginationControl($this->data,"Sliding","pagination.phtml");  ?>
<table>
	<thead>
		<tr>
			<td>Id </td>
			<td>Tên</td>
			<td>Đường dẫn</td>
			<td>Thao tác</td>
		</tr>
	</thead>
	<tbody>
			<?php
				if(!empty($this->data)): 
			?>
			<?php foreach($this->data as $item): ?>
			<tr class="">
				<td><?php echo $item['id']; ?></td>
				<td><?php echo $item['name']; ?></td>
				<td><?php echo $item['link']; ?></td>
				<td>
					<a class="edit" href="<?php echo $this->url(array("module"=>"administrator","controller"=>"video","action"=>"edit","id"=>$item['id']),null,true); ?>">Cập nhật</a>
					<a class="delete" href="<?php echo $this->url(array("module"=>"administrator","controller"=>"video","action"=>"remove","id"=>$item['id']),null,true);?>">Xóa</a>
				</td>
			</tr>
		     <?php endforeach; ?>
			 	
			 		
			 		
			 <?php else :?>
			 <tr>
			 	<td colspan=4>
			 	Chưa có video nào.
				</td>
			 </tr>
			 <?php endif; ?>
			
			
			
	</tbody>
	
</table>
<?php echo $this->paginationControl($this->data,"Sliding","pagination.phtml");  ?>
</div>
<script type="text/javascript">
	$(document).ready(function(){
			$(".delete").click(function(){
				if(confirm("Ban mua xoa ?")){
					$(this).parent().parent().remove();
					$.get($(this).attr("href"));
				}
				return false;
			});
	});
</script>
<script>
    $(function() {
        $( "#keyword" ).autocomplete({
            source: "<?php echo $this->url(array('module'=>'administrator','controller'=>'place','action'=>'datanamejson'));?>",
            minLength: 1
        });
    });
</script>